#include "comm.hpp"

int main()
{
    //1.打开管道文件
    int fd = open(P_PATH.c_str(),O_WRONLY);
    if(fd < 0)
    {
        perror("open");
        exit(1);
    }
    //2.写入
    std::string buffer;
    while(true)
    {
        std::cout << "please input something->";
        getline(std::cin,buffer);
        write(fd,buffer.c_str(),buffer.size());
    }

    //3.关闭管道文件
    close(fd);
    return 0;
}